// 发布文章相关的所有请求
import { request } from "@/utils";

// 获取频道列表
export const getChannelList = () => {
  return request.get('/channels');
}

// 发布文章
export const addArticle = data => {
  return request.post('/mp/articles?draft=false', data)
}

// 获取文章详情
export const getArticleDetail = articleId => {
  return request.get(`/mp/articles/${articleId}`);
}

export const updateArticle = data => {
  const { articleId, ...params } = data;
  return request.put(`/mp/articles/${articleId}?draft=false`, params);
}